import request from "@/request/api";
/* ----------------专项台账---------------- */

//查询分页列表
export function getListApi(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/queryList",
    method: "get",
    params: data,
  });
}
//查询详情
export function getDetailsApi(projectId = "") {
  return request({
    url: "/eam-service-sinoprobe/sp/project/selectOne",
    method: "get",
    params: {
      projectId,
    },
  });
}
//保存
export function saveDetailsApi(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/save",
    method: "post",
    data: data,
  });
}
//保存
export function deleteDetailsApi(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/delete",
    method: "delete",
    params: data,
  });
}
//导入
export function importApi(file, pkgId) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/import",
    method: "post",
    data: file,
    params: {
      pkgId,
    },
  });
}
//保存项目概况的绑定设备
export function saveEquipmentApi(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/equipment/save",
    method: "post",
    data: data,
  });
}
//按名字模糊查询里程碑列表
export function queryNameListApi(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/milestone/queryNameList",
    method: "get",
    params: data,
  });
}

//获取项目台账的项目关联对应专项工程数据的次数
export function getProjectRef(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/getProjectRef",
    method: "get",
    params: data,
  });
}
//获取项目台账的所有部门
export function getProjectDeptApi() {
  return request({
    url: "/eam-service-sinoprobe/sp/project/getProjectDept",
    method: "get",
  });
}
//获取项目台账的项目概览统计
export function getProjectOverviewApi(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/getProjectOverview",
    method: "get",
    params: data,
  });
}
//获取项目台账的项目进度条统计
export function getProjectProgressApi(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/getProjectProgress",
    method: "get",
    params: data,
  });
}
// 专项台账更新 终结审核理由
export function updateReasonApi(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/update",
    method: "post",
    data: data,
  });
}

/* ----------------里程碑管理---------------- */
//根据计划/项目id查询里程碑
export function getMilestoneApi(spId = "") {
  return request({
    url: "/eam-service-sinoprobe/sp/project/milestone/getBySpId",
    method: "get",
    params: {
      spId,
    },
  });
}
//更新里程碑
export function updateMilestoneApi(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/milestone/update",
    method: "post",
    data: data,
  });
}
//里程碑条件查询
export function milestoneListApi(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/milestone/queryList",
    method: "get",
    params: data,
  });
}
// 根据项目/计划id查询里程碑（获取里程碑节点列表里最新的里程碑节点）
export function getMileStoneBySpId(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/milestone/getLatestBySpId",
    method: "get",
    params: data,
  });
}

/* ----------------项目汇报---------------- */
//根据id删除项目汇报
export function deleteReportApi(id = "") {
  return request({
    url: "/eam-service-sinoprobe/sp/project/report/deleteById",
    method: "get",
    params: {
      id,
    },
  });
}
//查询项目汇报分页列表
export function getReportListApi(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/report/queryList",
    method: "get",
    params: data,
  });
}
//新增或修改项目汇报
export function updateReportApi(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/report/saveOrUpdate",
    method: "post",
    data: data,
  });
}
//查询项目汇报详情
export function getReportDetailsApi(id = "") {
  return request({
    url: "/eam-service-sinoprobe/sp/project/report/selectOne",
    method: "get",
    params: {
      id,
    },
  });
}
//获取最新项目汇报
export function getLatestReportApi(id = "") {
  return request({
    url: "/eam-service-sinoprobe/sp/project/report/getLatestReport",
    method: "get",
    params: {
      id,
    },
  });
}
//获取年度支出列表（实时统计，只查不存）
export function getReportSpendApi(id = "") {
  return request({
    url: "/eam-service-sinoprobe/sp/project/report/getReportSpend",
    method: "get",
    params: {
      id,
    },
  });
}

/* ----------------项目合同---------------- */
//根据id删除项目合同
export function deleteContractApi(id = "") {
  return request({
    url: "/eam-service-sinoprobe/sp/project/contract/deleteById",
    method: "get",
    params: {
      id,
    },
  });
}
//查询项目合同列表
export function getContractListApi(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/contract/queryList",
    method: "get",
    params: data,
  });
}
//新增或修改项目合同
export function updateContractApi(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/contract/saveOrUpdate",
    method: "post",
    data: data,
  });
}
//查询项目合同详情
export function getContractDetailsApi(id = "") {
  return request({
    url: "/eam-service-sinoprobe/sp/project/contract/selectOne",
    method: "get",
    params: {
      id,
    },
  });
}

/* ----------------项目合同-合同付款记录---------------- */

//查询项目合同列表-合同付款记录
export function getRecordListApi(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/contractRecord/queryList",
    method: "get",
    params: data,
  });
}
//新增或修改项目合同-合同付款记录
export function updateRecordApi(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/contractRecord/saveOrUpdate",
    method: "post",
    data: data,
  });
}

/* ----------------项目大事记---------------- */
//根据id删除项目大事记
export function deleteMemorabiliaApi(id = "") {
  return request({
    url: "/eam-service-sinoprobe/sp/project/memorabilia/deleteById",
    method: "get",
    params: {
      id,
    },
  });
}
//查询项目大事记列表
export function getMemorabiliaListApi(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/memorabilia/queryList",
    method: "get",
    params: data,
  });
}
//新增或修改项目大事记
export function updateMemorabiliaApi(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/memorabilia/saveOrUpdate",
    method: "post",
    data: data,
  });
}
//查询项目大事记详情
export function getMemorabiliaDetailsApi(id = "") {
  return request({
    url: "/eam-service-sinoprobe/sp/project/memorabilia/selectOne",
    method: "get",
    params: {
      id,
    },
  });
}
/* ----------------项目文档---------------- */
//根据id删除项目文档
export function deleteDocumentApi(id = "") {
  return request({
    url: "/eam-service-sinoprobe/sp/project/document/deleteById",
    method: "get",
    params: {
      id,
    },
  });
}
//查询项目文档列表
export function getDocumentListApi(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/document/queryList",
    method: "get",
    params: data,
  });
}
//新增或修改项目文档
export function updateDocumentApi(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/document/saveOrUpdate",
    method: "post",
    data: data,
  });
}
//查询项目文档详情
export function getDocumentDetailsApi(id = "") {
  return request({
    url: "/eam-service-sinoprobe/sp/project/document/selectOne",
    method: "get",
    params: {
      id,
    },
  });
}

/* ----------------项目办结---------------- */
//查询项目办结详情
export function getConcludeDetailsApi(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/conclude/selectOne",
    method: "get",
    params: data,
  });
}
//新增或修改项目办结
export function saveOrUpdate(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/conclude/saveOrUpdate",
    method: "post",
    data: data,
  });
}
// 项目办结分页查询
export function queryList(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/conclude/queryList",
    method: "get",
    params: data,
  });
}
// 项目办结根据id删除
export function deleteById(id = "") {
  return request({
    url: "/eam-service-sinoprobe/sp/project/conclude/deleteById",
    method: "get",
    params: {
      id,
    },
  });
}

/* ----------------项目变更---------------- */
// 分页查询
export function getChangeListApi(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/change/queryList",
    method: "get",
    params: data,
  });
}
// 新增或修改
export function saveOrUpdateProjectChange(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/change/saveOrUpdate",
    method: "post",
    data: data,
  });
}
// 获取详情
export function getChangeDetailsApi(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/change/getDetailById",
    method: "get",
    params: data,
  });
}
/* ----------------项目单据---------------- */
// 获取项目单据
export function getDocumentsListApi(data) {
  return request({
    url: "/eam-service-sinoprobe/sp/project/bills/queryList",
    method: "get",
    params: data,
  });
}
